1. Field of the Invention
The present invention relates to a contention control processor for a database system, and in particular, to a contention control processor that delays the execution of a transaction that has requested access to a resource until the execution of a transaction that requested access to the resource earlier is completed, when a contention occurs where multiple transactions concurrently request access to the same resource in a database.
2. Description of the Prior Art
A database system is provided with files forming a database and a means for retrieving these files. A transaction is generated for each processing unit, as an access procedure, whereby each resource in the database is accessed. Such a database system is provided with a processor for performing contention control wherein, if a contention occurs where multiple transactions concurrently request access to the same resource, one transaction is preferentially executed ahead of the others, queuing the others.
One conventional type of contention control processor operates in such a manner that the processing of a transaction that issues an access request later is delayed until the processing of a transaction that issued an access request earlier has been executed. This type of contention control processor is provided-with a concurrency controller for detecting the occurrence of a contention among transactions or the resolution of a contention, a transaction controller for controlling the queuing of the transaction that issued an access request later or the canceling of its queuing, and a deadlock controller for detecting the occurrence of a deadlock caused by contention among the transactions within the same system.
In such a contention control processor, the following processes are conducted when a resource T2 requests access to a resource that is already occupied by another transaction. First, the concurrency controller that received the access request of transaction T2 detects the occurrence of a contention, and posts the transaction controller with this information. The transaction controller, being posted with the information, queues (delays) the execution of transaction T2. Next, the concurrency controller simultaneously detects the completion of the execution of transaction T1 and the resolution of the contention over the resource, and posts the transaction controller with information regarding the resolution, whereby the transaction controller cancels the queuing of transaction T2 so that the execution of transaction T2 can begin.
However, if contention control is performed in a manner so as to queue the execution of such transactions, the system may be led into a so-called deadlock situation. A deadlock situation occurs, for example, when transaction T2 is waiting for the completion of transaction T1 after requesting an access to the resource occupied by transaction T1, and transaction T1 tries to use the resource occupied by transaction T2. T1 contends with transaction T2 for the same resource, having its own execution delayed, and as a result, both transactions T1 and T2 are queued, being suspended in the condition that the execution of both transactions is delayed. The occurrence of such a deadlock is detected by the deadlock controller, which obtains information regarding the contention from the concurrency controller. When a deadlock is detected, the deadlock controller tries to resolve the deadlock by freeing the resource from the access request of one of transactions, so that the other transaction can be preferentially executed.
Incidentally, this type of processor has been applied to so-called centralized database systems. The contention control processor described above detects contention, the resolution of the contention or the occurrence of a deadlock only within its own system, and the countermeasure processing is also completed within its own system. However, recently, in order to retrieve a wider range of information, research has been performed on distributed database processing systems wherein multiple database systems are interconnected by means of a network, for example, a local area network or a global area network, so that the multiple database systems can be operated like a single database system.
However, in a distributed database processing system, the contention control processor described above is unable to handle the situation where a so-called distributed deadlock has occurred. A distributed deadlock occurs when transactions generated from the separate database processors in a distributed database processing system form a contention simultaneously involving the separate processors, and as a result, the separate database processors are effectively locked to each other.